package com.example.demo.mapper;

import com.example.demo.pojo.Wallet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface WalletMapper {

    @Select("select * from wallet where account_id = #{accountId}")
    Wallet get(Long accountId);

    @Update("update wallet set money=money-100 where id=#{id}")
    void payHundred(Long id);

    @Update("update wallet set money=money+20 where id=#{id}")
    void getTwenty(Long id);
}
